<template>
  <div class="recommend">
    <div class="recommend-title">热销推荐</div>
    <ul>
      <router-link :to="'/detail/' + item.id" tag="li" class="item border-bottom" v-for="item of recommend" :key="item.id">
        <img class="item-img" :src="item.imgUrl" alt="">
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'Recommend',
  props: {
    recommend: Array
  }
}
</script>

<style lang="stylus" scoped>
  @import "~styles/mixins.styl"
  .recommend
    margin-top .1em
    .recommend-title
      background-color: #eee
      line-height: .8rem
      text-indent .2rem
    .item
      height: 1.8rem
      display flex
      .item-img
        width: 1.6rem
        height: 1.6rem
        padding: .1rem
      .item-info
        flex: 1
        font-size: 0.24rem
        padding: .1rem
        .item-title
          line-height: .54rem
          font-size .3rem
          ellipsis()
        .item-desc
          line-height: .4rem
          color: #bbb
          ellipsis()
        .item-button
          color: #ffffff
          line-height: .44rem
          margin-top .16rem
          background-color: #ff9300
          padding: 0 .2rem
          border-radius .06rem
</style>
